package com.lovo;

import java.io.*;
import java.util.Properties;

public class PropertiesUtil extends Properties {

    public void store(String path,String comments) {
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(path);
            this.store(fos,comments);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(fos != null){
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
    public void load(String path){
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(path);
            this.load(fis);

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(fis != null){
                try {
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
